<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateAdminPanelNavsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('admin_panel_navs', function (Blueprint $table) {
            $table->increments('id');
            $table->string('name')->unique(); // 名称用于从语言文件包中检索
            $table->integer('parent_id')->default(0)->unsigned();
            $table->string('icon');
            $table->string('route')->nullable();
            $table->string('href')->nullable();
            $table->tinyInteger('sort')->default(0)->unsigned();

            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::drop('admin_panel_navs');
    }
}
